package com.huawei.appgallery.forum.posts.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.Nullable;
import o.epv;

public class PostCommentTriangleView extends View {
    private int ˋ;
    private int ˎ;
    private int ˏ;

    public PostCommentTriangleView(Context context) {
        super(context);
        ˊ(context);
    }

    private void ˊ(Context context) {
        this.ˎ = epv.ˋ(context, 20);
        this.ˋ = epv.ˋ(context, 8);
    }

    public PostCommentTriangleView(Context context, @Nullable AttributeSet attributeSet) {
        super(context, attributeSet);
        ˊ(context);
    }

    public PostCommentTriangleView(Context context, @Nullable AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˊ(context);
    }

    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        Paint paint = new Paint();
        paint.setColor(this.ˏ);
        Path path = new Path();
        path.moveTo(0.0f, (float) this.ˋ);
        path.lineTo(((float) this.ˎ) / 2.0f, 0.0f);
        path.lineTo((float) this.ˎ, (float) this.ˋ);
        path.close();
        canvas.drawPath(path, paint);
    }

    public void setColor(int i) {
        this.ˏ = i;
    }
}
